package converters;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import domain.PurchasedItem;

@Component
@Transactional
public class PurchasedItemToStringConverter implements Converter<PurchasedItem, String>{
	
	@Override
	public String convert(PurchasedItem purchasedItem) {
		String result;

		if (purchasedItem == null)
			result = null;
		else
			result = String.valueOf(purchasedItem.getId());

		return result;
	}


}
